package com.leagueoflegends.service.impl;

import com.github.pagehelper.PageHelper;
import com.leagueoflegends.bean.ChampionSkin;
import com.leagueoflegends.bean.ChampionSkinDTO;
import com.leagueoflegends.bean.ChampionSkinVO;
import com.leagueoflegends.mapper.ChampionSkinMapper;
import com.leagueoflegends.service.ChampionSkinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ChampionSkinServiceImpl implements ChampionSkinService {

    @Autowired
    ChampionSkinMapper championSkinMapper;

    @Override
    public void insert(ChampionSkin skin) {
        championSkinMapper.insert(skin);
    }

    @Override
    public void deleteById(Integer id) {
        championSkinMapper.deleteById(id);
    }

    @Override
    public void deleteByChampionId(Integer championId) {
        championSkinMapper.deleteByChampionId(championId);
    }

    @Override
    public void update(ChampionSkin skin) {
        championSkinMapper.update(skin);
    }

    @Override
    public List<ChampionSkin> select(Integer championId) {
        return championSkinMapper.select(championId);
    }

    /**
     * 进入皮肤管理界面查看所有皮肤
     * @return
     */
    @Override
    public List<ChampionSkin> SelectChampionSkin() {
        System.out.println("执行了查询所有皮肤的实现类");
        return championSkinMapper.SelectChampionSkin();
    }




@Override
public List<ChampionSkinDTO> selectAll1(int pageNum, int pageSize, String type, String find) {
    PageHelper.startPage(pageNum,pageSize);
    return championSkinMapper.selectAllDTO(type,find);
}

}
